//
//  EditArrayViewController.m
//  ClassManager
//
//  Created by ihope99 on 2017/8/13.
//  Copyright © 2017年 GZX. All rights reserved.
//

#import "EditArrayViewController.h"

@interface EditArrayViewController (){
    NSArray *mArray;
}

@end

@implementation EditArrayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    
    mArray = @[@"1",@"2",@"3",@"4",@"5",@"6",@"7"];
    
    NSString *max = [mArray GetMaxData];
    NSString *min = [mArray GetMinData];
    NSString *avg = [mArray GetAvgData];
    NSString *sum = [mArray GetSumData];
    
    DLog(@"最大值是%@,最小值是%@,平均数是%@,数组之和是%@",max,min,avg,sum);
    
    //删除重复数据
    mArray = @[@"1",@"1",@"1",@"1",@"1",@"6",@"7"];
    DLog(@"删除之后是%@",[mArray GetDeleteRepeatData]);
    
    mArray = @[@{@"name":@"1"},
               @{@"name":@"2"},
               @{@"name":@"3"},
               @{@"name":@"4"},
               @{@"name":@"5"},
               @{@"name":@"6"},
               @{@"name":@"7"},
               @{@"name":@"8"}];
    DLog(@"提取之后的数据%@",[mArray GetDictKeyToArray:@"name"]);
    
    mArray = @[@{@"name":@"1"},
               @{@"name":@"1"},
               @{@"name":@"3"},
               @{@"name":@"4"},
               @{@"name":@"5"},
               @{@"name":@"6"},
               @{@"name":@"7"},
               @{@"name":@"8"}];
    DLog(@"提取冰删除之后的数据%@",[mArray GetDictKeyToArrayAndDeleteRepect:@"name"]);
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
